﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DBconnection;

namespace AddParameter_Form
{
    public partial class AddParameterForm : Form
    {
        public string SelecetedText { get; set; }

        private string[] _ListOfClasses;
        private string[] _ListOfParm;
        private string _Class;

        public AddParameterForm(string Class)
        {
            InitializeComponent();
            _Class = Class;
            cmbClasses.Items.Add(_Class);
            cmbClasses.Enabled = false;
            cmbParm.Items.Clear();
            _ListOfParm = DB.GetParameters(_Class);
            cmbParm.Items.AddRange(_ListOfParm);
        }
        
        //private void cmbClasses_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    cmbParm.Items.Clear();
        //    _ListOfParm = DB.GetParameters(cmbClasses.SelectedItem.ToString());
        //    cmbParm.Items.AddRange(_ListOfParm);
        //    cmbParm.Enabled = true;
        //}
        
        private void cmbParm_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Get English Parm
            string EngParm = DB.GetEngName_Parm(cmbParm.SelectedItem.ToString(),_Class);
            SelecetedText = "[" + _Class + "." + EngParm + "]";
        }
     
    }
}
